#include <iostream>
#include <string>

#include "Sort.h"
#include "QuickSort.h"
#include "BubbleSort.h"
#include "RecursiveBinarySearch.h"

using namespace std;

void print(int a[], int n) {

	for (int j = 0; j < n; j++) {
		cout << a[j] << " ";
	}
	cout << endl;
}

int main(int argc, char* argv[]) {

	BubbleSort m_bSort;
	QuickSort m_qSort;
	RecursiveBinarySearch searchBin;

	/// init
	int q_arr[1000] = {};

	int num = 0;
	while (cin >> q_arr[num]) {
		num++;
	}

	int b_arr[1000] = {};
	for (int i = 0; i < num; i++) {
		b_arr[i] = q_arr[i];
	}

	/// test
	// quick sort
	//cout << "Quick Sort:" << endl;
	//cout << "Initial sequence:";
	///print(q_arr, num);

	m_qSort.m_Sort(q_arr, 0, num - 1);

	if (!searchBin.Binary_Search2(q_arr, 0, num - 1, 1)) {
		cout << "true ";
	}
	else {
		cout << "false ";
	}

	//cout << "Sort results:";
	print(q_arr, num);

	//// bubble sort
	////cout << "Bubble Sort:" << endl;
	////cout << "Initial sequence:";
	//print(b_arr, num);

	//m_bSort.m_Sort(b_arr, num, 0);

	//if (!searchBin.Binary_Search2(b_arr, 0, num - 1, 1)) {
	//	cout << "true ";
	//}
	//else {
	//	cout << "false ";
	//}

	////cout << "Sort results:";
	//print(b_arr, num);

	return 0;
}
